package OneAagin;

import com.lovo.netCRM.component.LovoButton;
import com.lovo.netCRM.component.LovoTxt;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.time.LocalTime;

public class LoginFrame extends JFrame {
    private LovoTxt userTxt = new LovoTxt("用户名",60,50,this);
    private LovoTxt pwdTxt = new LovoTxt("密码",60,100,this);
    private ILogin login = new LonginImpl();

    public LoginFrame(){
        this.setLayout(null);
        this.init();

        this.setSize(400,300);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);

    }

    private void init(){
        LovoButton loginButton = new LovoButton("登录",150,180,this);
        loginButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                login.login(userTxt.getText(),pwdTxt.getText());
            }
        });
    }

    public static void main(String[] args) {
        new LoginFrame();
    }
}
